package org.springcloud.wisdom.amusement.controller.sys;

import org.springcloud.wisdom.amusement.bean.ResponseData;
import org.springcloud.wisdom.amusement.controller.BaseController;
import org.springcloud.wisdom.amusement.entity.Wall;
import org.springcloud.wisdom.amusement.service.IWallService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@RequestMapping("/sys/wall")
public class WallController extends BaseController {
    @Autowired
    IWallService wallService;

    //获取万能墙上所有的消息
    @GetMapping("gets")
    public ResponseData<Object> getAllWallMsg() {
        return returnObject(wallService.getAllWallMsg());
    }

    //获取所有被举报次数过多而自动删除的信息
    @GetMapping("gets2")
    public ResponseData<Object> getDelWallMsg() {
        return returnObject(wallService.getDelWallMsg());
    }

    //获取所有被举报信息
    @GetMapping("gets3")
    public ResponseData<Object> getAllReportMsg() {
        return returnObject(wallService.getAllReportMsg());
    }

    //删除墙上信息
    @DeleteMapping("delete/{id}")
    public ResponseData<Boolean> deleteWallMsg(@PathVariable("id") Integer id) {
        return returnBoolean(wallService.deleteWallMsg(id));
    }

    //发表信息在墙上
    @PostMapping("add")
    public ResponseData<Boolean> addWallMsg(Wall wall) {
        return returnBoolean(wallService.addWallMsg(wall));
    }

    //改你没有加requestBody  后面出错过来改这个
    //举报信息
    @PutMapping("update")
    public ResponseData<Boolean> reportWallMsg(Integer id) {
        return returnBoolean(wallService.reportWallMsg(id));
    }

    //恢复被举报信息
    @PutMapping("update2")
    public ResponseData<Boolean> rejectNotice(Integer id) {
        return returnBoolean(wallService.judgeWallMsg(id));
    }

    //恢复被举报被自动删除的信息
    @PutMapping("update3")
    public ResponseData<Boolean> recoverDeleteMsg(Integer id) {
        return returnBoolean(wallService.recoverDeleteMsg(id));
    }




}
